<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>如何画一个三角形(实心)</h1>
    <div class="border"></div>
    <h1>空心三角形</h1>
    <div class="border2">

    </div>
    <style>
        .border {
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 0 50px 50px;
            border-color: transparent transparent #d9534f transparent;
        }

        .border2 {
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 0 50px 50px;
            border-color: transparent transparent #d9534f;
            position: relative;
        }

        .border2:after {
            content: '';
            border-style: solid;
            border-width: 0 40px 40px;
            border-color: transparent transparent white;
            position: absolute;
            top: 6px;
            left: -40px;
        }
    </style>
</body>

</html>